/*            Copyright(c) 2006-2008 Dave Sexton           *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DaveSexton.DocProject.Sandcastle.TopicManagement
{
	internal sealed partial class TopicFilterEditorHostDialog : Form
	{
		#region Public Properties
		public ITopicFilterEditor Editor
		{
			set
			{
				editor = value;
			}
		}

		public ITopicFilter Filter
		{
			set
			{
				filter = value;
			}
		}
		#endregion

		#region Private / Protected
		private ITopicFilterEditor editor;
		private ITopicFilter filter;
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="TopicFilterEditorHostDialog" /> class.
		/// </summary>
		public TopicFilterEditorHostDialog()
		{
			InitializeComponent();
		}
		#endregion

		#region Methods
		private void Initialize()
		{
			Text = string.Format(System.Globalization.CultureInfo.CurrentCulture, Text, editor.Title);

			Control control = (Control) editor;
			control.Dock = DockStyle.Fill;

			Controls.Add(control);

			editor.BindFilter(filter);
		}
		#endregion

		#region Event Handlers
		protected override void OnLoad(EventArgs e)
		{
			Initialize();

			base.OnLoad(e);
		}
		#endregion
	}
}